package com.onegene.pdf.component.paint;

import com.itextpdf.kernel.font.PdfFont;
import com.itextpdf.kernel.geom.PageSize;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfPage;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import lombok.Getter;
import lombok.Setter;

/**
 * @author: laoliangliang
 * @description:
 * @create: 2020/7/3 16:21
 **/
@Getter
@Setter
public abstract class AbstractPainting {
    protected PdfCanvas pdfCanvas;
    protected PageSize pageSize;
    protected PdfDocument pdf;
    protected PdfFont font;

    public AbstractPainting(PdfDocument pdf, PdfFont font) {
        this.pdf = pdf;
        this.font = font;
        PdfPage page = pdf.getPage(pdf.getNumberOfPages());
        pageSize = pdf.getDefaultPageSize();
        pdfCanvas = new PdfCanvas(page);
    }
}
